//
//  MineViewController.m
//  A手工客
//
//  Created by 萌萌的小坤坤 on 16/6/13.
//  Copyright © 2016年 冷坤. All rights reserved.
//

#import "MineViewController.h"
#import "JXLDayAndNightMode.h"


#define WIDTH self.view.frame.size.width

#define HEIGHT self.view.frame.size.height

#define COLORS [UIColor colorWithRed:(arc4random() % 256 / 255.0) green:(arc4random() % 256 / 255.0) blue:(arc4random() % 256 / 255.0) alpha:1.0];

@interface MineViewController ()

@end

@implementation MineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UILabel *lableTitle = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH * 0.78, HEIGHT * 0.27, WIDTH * 0.2, 10)];
    lableTitle.text = @"夜间模式";
    lableTitle.textColor = [UIColor orangeColor];
    [self.view addSubview:lableTitle];
    [lableTitle release];
    
    UISwitch *switchView = [[UISwitch alloc]initWithFrame:CGRectMake(WIDTH * 0.8 , HEIGHT * 0.2, 30, 15)];
    switchView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:switchView];
    if (JXLDayAndNightModeDay == [[JXLDayAndNightManager shareManager] contentMode]) {
        switchView.on = NO;
    }else{
        switchView.on = YES;
        
    }
    [switchView addTarget:self action:@selector(toOne:) forControlEvents:UIControlEventValueChanged];
    
    [switchView release];
}
-(void)toOne:(UISwitch *)swith{
    
    if (swith.on) {
        [[JXLDayAndNightManager shareManager] nightMode];
    }else{
        [[JXLDayAndNightManager shareManager] dayMode];
    }
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
